<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>

    let that=''
     function Star(name,age){
      this.name=name
      this.age=age
    }

    // Star.prototype.sing=function(){
    //   console.log('唱跳rgp');
    // }
    // const ldh=new Star('刘德华',48)
    // console.log(ldh);
    // ldh.sing()
    // const lm=new Star('黎明',45)
    // console.log(lm);

    // console.log(ldh.sing===lm.sing);


    Star.prototype.sing=function(){
      console.log('唱跳rap');
    }
    const ldh=new Star('刘德华',45)
    console.log(ldh);
    ldh.sing()
    console.log(that);
  </script>
</body>

</html>